home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-06-14 | 2.2 KB | 74 lines | [TEXT/R*ch] |
- // This header file defines standard types and constants
- // that all of my programs tend to assume
- // (C) 1993-1995 Stuart Cheshire <cheshire@cs.stanford.edu>
-
- // ************************************************************
- // Basic C definitions
-
- #define local static
- #define import extern
- #define export
- #define until(A) while(!(A))
- #define elementsof(A) (sizeof(A)/sizeof((A)[0]))
- #define semiconst const
-
- typedef unsigned char u_char;
- typedef unsigned short u_short;
- typedef unsigned long u_long;
-
- typedef u_char NIBBLE; // to be interpreted as four bits
- typedef u_char BYTE;
- typedef u_short WORD;
- typedef u_long DWORD;
- typedef union { DWORD dword[2]; WORD word[4]; BYTE byte[ 8]; } QWORD;
- typedef union { DWORD dword[4]; WORD word[8]; BYTE byte[16]; } OCTWORD;
-
- typedef struct { char c[ 4]; } char4;
- typedef struct { u_char c[ 4]; } u_char4;
- typedef struct { char c[ 32]; } char32;
- typedef struct { u_char c[ 32]; } u_char32;
- typedef struct { char c[ 36]; } char36;
- typedef struct { u_char c[ 36]; } u_char36;
- typedef struct { char c[ 64]; } char64;
- typedef struct { u_char c[ 64]; } u_char64;
- typedef struct { char c[256]; } char256;
- typedef struct { u_char c[256]; } u_char256;
-
- // ************************************************************
- // 68000 processor related definitions
-
- #pragma parameter __D0 DisableInterrupts() // MOVE SR,D0 ORI.W #$0700,SR
- local short DisableInterrupts(void) = { 0x40C0, 0x007C, 0x0700 };
-
- #pragma parameter RestoreInterrupts(__D0) // MOVE D0,SR
- local void RestoreInterrupts(short oldval) = { 0x46C0 };
-
- // ************************************************************
- // Macintosh OS related definitions
-
- // Serial Driver
- #define SerHShake_V2 14
-
- // Baud rate constants: formula is (115200/baud)-2
- #define baud38400 1
- #define baud28800 2
-
- // Time Manager
- #define TMTaskActiveBit 0x8000
-
- // File Manager
- #define fsNoCache 0x20
-
- // ************************************************************
- // Symantec compiler related definitions
-
- #if __option(a4_globals)
- #define GLOBREG A4
- #pragma parameter __A0 GetGlobalsRegister() // MOVEA.L A4,A0
- local void* GetGlobalsRegister(void) = { 0x204C };
- #else
- #define GLOBREG A5
- #pragma parameter __A0 GetGlobalsRegister() // MOVEA.L A5,A0
- local void* GetGlobalsRegister(void) = { 0x204D };
- #endif
-